package com.lsu.observer.homework;

/**
 * 火警报警器
 *
 * @Author wang suo
 * @Date 2020/10/22 0022 9:05
 * @Version 1.0
 */
public class SirenObserver implements Observer {

    private Integer id;

    SirenObserver(Integer id, Subject subject) {
        this.id = id;
        subject.addObserver(this);
    }

    @Override
    public void update() {
        System.out.println("报警器" + id + "号报警了!");
    }
}
